package com.xy.modular.shop.entity;

import com.xy.framework.base.entity.Entity;

import java.math.BigDecimal;

/**
 * <p>
 * 8. 商品库存量表 product_sku 此表为关键表，根据商品的属性和属性值来判定商品的价格和库存量
 * </p>
 *
 * @author BCK
 * @since 2019-10-12
 */
public class ProductSku extends Entity {

    private static final long serialVersionUID = 1L;

    /**
     *  	商品ID 	关联product表ID
     */
    private Integer productId;
    /**
     * 属性键值对 	property_name:property_value 关联两张表的ID
     */
    private String properties;
    /**
     *  	商品价格 	-
     */
    private BigDecimal price;
    /**
     *  	商品成本 	可有可无值
     */
    private BigDecimal cost;
    /**
     *  	库存 	-
     */
    private Integer stock;
    /**
     *  	重量 	克
     */
    private Integer weight;
    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }
    public String getProperties() {
        return properties;
    }

    public void setProperties(String properties) {
        this.properties = properties;
    }
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }
    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }
    public Integer getWeight() {
        return weight;
    }

    public void setWeight(Integer weight) {
        this.weight = weight;
    }

    public static final String PRODUCT_ID = "shop_product_sku.product_id";
    public static final String PROPERTIES = "shop_product_sku.properties";
    public static final String PRICE = "shop_product_sku.price";
    public static final String COST = "shop_product_sku.cost";
    public static final String STOCK = "shop_product_sku.stock";
    public static final String WEIGHT = "shop_product_sku.weight";

    @Override
    public String toString() {
        return "ProductSku{" +
            "productId=" + productId +
            ", properties=" + properties +
            ", price=" + price +
            ", cost=" + cost +
            ", stock=" + stock +
            ", weight=" + weight +
        "}";
    }
}
